# -*- coding: utf-8 -*-

"""
@author: kk
@Remark: 设备信息管理
"""
from app.device.models import Devices
from dvadmin.utils.serializers import CustomModelSerializer
from dvadmin.utils.viewset import CustomModelViewSet


class DevicesSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = Devices
        fields = "__all__"
        read_only_fields = ["id"]


class DevicesViewSet(CustomModelViewSet):
    """
    设备信息接口
    list:设备信息查询
    create:设备信息新增
    update:设备信息修改
    retrieve:设备信息单例
    destroy:设备信息删除
    multiple_delete:设备信息多删
    """
    queryset = Devices.objects.all()
    serializer_class = DevicesSerializer
    # filter_fields = ['creator_id']

    # permission_classes = []
